package com.shiguiwu.springmybatis.designpattern.strategy.event;

import com.shiguiwu.springmybatis.designpattern.strategy.ICouponDiscount;
import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * @description: n元购
 * @author: stone
 * @date: Created by 2021/9/9 17:17
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.designpattern.strategy.event
 */
@Slf4j
public class NYGCouponDiscount implements ICouponDiscount<Double> {
    /**
     * 无论原来多少价格，都么有用
     *
     * @param couponInfo 券折扣信息；直减、满减、折扣、N元购
     * @param price      sku⾦金金额
     * @return
     */
    @Override
    public BigDecimal discountAmount(Double couponInfo, BigDecimal price) {
        log.info("n元购优惠：原来价格是 {}，最终价格是{}",  price, couponInfo);
        return new BigDecimal(couponInfo);
    }

}
